{% extends "base.html" %}

{% block content %}

<script language="javascript" src="/static/js/jquery-1.2.1.pack.js" type="text/javascript"></script>
<script type="text/javascript" src="/static/js/jquery-calendar-pack.js" ></script>
<style type="text/css">@import url(/static/css/jquery-calendar.css);</style>
<script language="javascript" type="text/javascript">
$(document).ready(
	function()
	{
    	popUpCal.regional['zh-cn'] = {dateFormat: 'DMY/'};
		popUpCal.setDefaults(popUpCal.regional['zh-cn']);
	    $('#date1').calendar({autoPopUp: 'focus',yearRange: '-5:+1'});
	    $('#date1_invoice').calendar({autoPopUp: 'focus',yearRange: '-5:+1'});
	    $('#date1_paid').calendar({autoPopUp: 'focus',yearRange: '-5:+1'});
	    $('#date2_invoice').calendar({autoPopUp: 'focus',yearRange: '-5:+1'});
	    $('#date2_paid').calendar({autoPopUp: 'focus',yearRange: '-5:+1'});
	    $('#date3_invoice').calendar({autoPopUp: 'focus',yearRange: '-5:+1'});
	    $('#date3_paid').calendar({autoPopUp: 'focus',yearRange: '-5:+1'});
	    $('#date4_invoice').calendar({autoPopUp: 'focus',yearRange: '-5:+1'});
	    $('#date4_paid').calendar({autoPopUp: 'focus',yearRange: '-5:+1'});
	    $('#date2').calendar({autoPopUp: 'focus',yearRange: '-5:+1'});
	    $('#date3').calendar({autoPopUp: 'focus',yearRange: '-5:+1'});
	    $('#date4').calendar({autoPopUp: 'focus',yearRange: '-5:+1'});
	    $('#datefee').calendar({autoPopUp: 'focus',yearRange: '-5:+1'});
	    $('#datefee_invoice').calendar({autoPopUp: 'focus',yearRange: '-5:+1'});
	    $('#datefee_paid').calendar({autoPopUp: 'focus',yearRange: '-5:+1'});
	    $('#datereg').calendar({autoPopUp: 'focus',yearRange: '-5:+1'});
	    $('#datereg_invoice').calendar({autoPopUp: 'focus',yearRange: '-5:+1'});
	    $('#datereg_paid').calendar({autoPopUp: 'focus',yearRange: '-5:+1'});
	}
);

function verify(form){
  if(form.amount.value==""){
		alert("Enter amount please!");
		form.amount.focus();  
       return false;
	}
	return true;
 }
 function setvalue()
 {
	var a=document.getElementById('amount').value; 
	var b=document.getElementById('discount_money').value; 
	var c=document.getElementById('module_wavied_money').value; 
	
	var dv;
	dv=a-b-c;
	sva=dv/4;
	document.getElementById('subtotal_money').value=dv; 
	//document.getElementById('date1_money').value=sva; 
	//document.getElementById('date2_money').value=sva; 
	//document.getElementById('date3_money').value=sva; 
	//document.getElementById('date4_money').value=sva; 
	
 }
 </script>
<style type="text/css">
<!--
body,td,th {
	font-size: 12px;
}
tr{margin-top:10px;}
.saminput{
width:70px;
}
-->
</style>
 <style>
 .list-div {
  width: 96%;
  border: 1px solid #BBDDE5;
}
.list-div table {
  border: 1px solid #BBDDE5;
  margin-top:5px;
}
.list-div th {
  line-height: 24px;
  background: #BBDDE5 url("/static/images/th_bg.gif") repeat-x;
  white-space: nowrap;
}

.list-div td {
  line-height: 22px;
}

</style>
</head>

<body>
<div class="tab-div">
    <!-- tab bar -->
    <div id="tabbar-div">
      <p>
        <span class="tab-back"  id="detail-tab"><a href="/v2/edit_student/{{s_obj.id}}/">{%if s_obj.last_name%}{{s_obj.last_name}} , {{s_obj.first_name}}{%else%}{{s_obj.name_ch}}{%endif%} Profile</a></span><span class="tab-back"  id="detail-tab"><a href="/v2/program_enrolled/{{s_obj.id}}/">{%if s_obj.last_name%}{{s_obj.last_name}} , {{s_obj.first_name}}{%else%}{{s_obj.name_ch}}{%endif%} Program Enrolled</a></span><span
        class="tab-front"  id="general-tab">{%if s_obj.last_name%}{{s_obj.last_name}} , {{s_obj.first_name}}{%else%}{{s_obj.name_ch}}{%endif%} Payment Record</span>
      </p>
    </div>
</div>	

<form name="saveenrool" method="post"  onsubmit='return verify(this);'>
 <div id="tabbody-div" class="list-div">
<table width="100%" border="0" background="#FFF">
  <tr>
    <td bgcolor="#E1FBFB">Program Enrolled: &nbsp;&nbsp;
      <select name="program_id" id="program_id" onChange="window.location='/v2/pay_record/{{s_obj.id}}/?program_id='+this.options[this.selectedIndex].value">
	<option value="">select please</option>
	{%for p in p_list%}
	<option value="{{p.id}}" {%if pp_obj == p%}selected{%endif%}>{{p.name}}</option>
	{%endfor%}
	</select>&nbsp;&nbsp;&nbsp;&nbsp;
	 Amount:<input type="text" name="amount" id="amount" value="{{pay_obj.amount}}{%if pay_obj == ''%}{{amountmoney_m}}{%endif%}"  onblur="javascript:setvalue();" onchange="javascript:setvalue();" onpropertychange="javascript:setvalue();" oninput="javascript:setvalue();" />
	 &nbsp;<select name="moneytype" id="moneytype">
	 <option value="HKD" {%if pay_obj.moneytype == 'HKD'%}selected{%endif%}>HKD</option>
	 <option value="USD" {%if pay_obj.moneytype == 'USD'%}selected{%endif%}>USD</option>
	 <option value="RMB" {%if pay_obj.moneytype == 'RMB'%}selected{%endif%}>RMB</option>
	 </select>&nbsp;&nbsp;<input type="checkbox" name="fullpay" id="fullpay" value="1" {%if pay_obj.fullpay%}checked{%endif%}/>Full Paid
	</td>
  </tr>
</table>

<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
    <td width="200">Discount:
	<select name="discount" id="discount">
	 <option value="earlybird" {%if pay_obj.discount == 'earlybird'%}selected{%endif%}>early bird</option>
	 <option value="referral" {%if pay_obj.discount == 'referral'%}selected{%endif%}>referral</option>
	 <option value="scholarship" {%if pay_obj.discount == 'scholarship'%}selected{%endif%}>scholarship</option>
	 </select></td>
    <td  width="200"><input type="text" name="discount_money" id="discount_money" value="{{pay_obj.discount_money}}" onblur="javascript:setvalue();" onchange="javascript:setvalue();"  onpropertychange="javascript:setvalue();" oninput="javascript:setvalue();" /></td>
    <td align="left">Referred By <input type="text" name="referredby" id="referredby" value="{{pay_obj.referredby}}" /></td>
	</tr>
  <tr>
    <td width="200">Module Wavied:
	<select name="module_wavied" id="module_wavied">
	 <option value="0"  {%if pay_obj.module_wavied == '0'%}selected{%endif%}>0</option>
	 <option value="1" {%if pay_obj.module_wavied == '1'%}selected{%endif%}>1</option>
	 <option value="2" {%if pay_obj.module_wavied == '2'%}selected{%endif%}>2</option>
	 <option value="3" {%if pay_obj.module_wavied == '3'%}selected{%endif%}>3</option>
	 <option value="4" {%if pay_obj.module_wavied == '4'%}selected{%endif%}>4</option>
	 <option value="5" {%if pay_obj.module_wavied == '5'%}selected{%endif%}>5</option>
	 <option value="6" {%if pay_obj.module_wavied == '6'%}selected{%endif%}>6</option>
	 <option value="7" {%if pay_obj.module_wavied == '7'%}selected{%endif%}>7</option>
	 <option value="8" {%if pay_obj.module_wavied == '8'%}selected{%endif%}>8</option>
	 <option value="9" {%if pay_obj.module_wavied == '9'%}selected{%endif%}>9</option>
	 </select></td>
    <td  width="200"><input type="text" name="module_wavied_money" id="module_wavied_money" value="{{pay_obj.module_wavied_money}}" onblur="javascript:setvalue();" onchange="javascript:setvalue();" onpropertychange="javascript:setvalue();" oninput="javascript:setvalue();" /></td>
    <td align="left">&nbsp;</td>
	</tr>
  <tr>
    <td width="200" align="right">&nbsp;Total:</td>
    <td  width="200"><input type="text" name="subtotal_money" id="subtotal_money" value="{{pay_obj.subtotal_money}}" /></td>
    <td align="left">
		<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#BBDDE5">
			<tr background="#BBDDE5">
			<td width="120"  background="#BBDDE5">Invoice Date</td>
			<td width="120"  background="#BBDDE5">Paid Date</td>
			<td width="120"  background="#BBDDE5">Paid By</td>
			<td width="120"  background="#BBDDE5">Handled By</td>
			</tr>
			</table>
	</td>
	</tr>
	</table>


<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
  <td  width="200">Application Fee<!--Registration Fee-->&nbsp;<input type="text" name="datefee" id="datefee" value="{{pay_obj.datefee}}" readonly size="10"></td>
  <td  width="200"><input type="text" name="datefee_money" id="datefee_money" value="{{pay_obj.datefee_money}}" />&nbsp;<select name="moneytypedatefee" id="moneytypedatefee">
	 <option value="HKD" {%if pay_obj.moneytypedatefee == 'HKD'%}selected{%endif%}>HKD</option>
	 <option value="USD" {%if pay_obj.moneytypedatefee == 'USD'%}selected{%endif%}>USD</option>
	 <option value="RMB" {%if pay_obj.moneytypedatefee == 'RMB'%}selected{%endif%}>RMB</option>
	 </select></td>
    <td align="left">
		<table width="100%" border="0" cellpadding="0" cellspacing="0" bordercolor="#B1D3EC" bgcolor="#FFFFFF">
			<tr>
			<td width="120"><input type="text" name="datefee_invoice" id="datefee_invoice" value="{{pay_obj.datefee_invoice}}" readonly size="10"></td>
			<td width="120"><input type="text" name="datefee_paid" id="datefee_paid" value="{{pay_obj.datefee_paid}}" readonly size="10"></td>
			<td width="120"><select name="datefee_paiy_by" id="datefee_paiy_by">
				<option value="">Select Please</option>
				 <option value="Cash" {%if pay_obj.datefee_paiy_by == 'Cash'%}selected{%endif%}>Cash</option>
				 <option value="Bank Transfer" {%if pay_obj.datefee_paiy_by == 'Bank Transfer'%}selected{%endif%}>Bank Transfer</option>
				 <option value="Credit Card" {%if pay_obj.datefee_paiy_by == 'Credit Card'%}selected{%endif%}>Credit Card</option>
				 <option value="EPS" {%if pay_obj.datefee_paiy_by == 'EPS'%}selected{%endif%}>EPS</option>
				 <option value="Cheque" {%if pay_obj.datefee_paiy_by == 'Cheque'%}selected{%endif%}>Cheque</option>
				 <option value="T/T" {%if pay_obj.datefee_paiy_by == 'T/T'%}selected{%endif%}>T/T</option>
				 </select></td>
			<td width="120"><select name="datefee_handed_by" id="datefee_handed_by">
			 <option value="">select please</option>
			{%for s in sale_list%}
			 <option value="{{s.name}}" {%if pay_obj.datefee_handed_by == s.name%}selected{%endif%}>{{s.name}}</option>
			 {%endfor%}
			</select></td>
			</tr>
			</table>
	</td>
	</tr>
	</table>



<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
  <td  width="200">Registration Fee<!--Registration Fee-->&nbsp;<input type="text" name="datereg" id="datereg" value="{{pay_obj.datereg}}" readonly size="10"></td>
  <td  width="200"><input type="text" name="datereg_money" id="datereg_money" value="{{pay_obj.datereg_money}}" />&nbsp;<select name="moneytypedatereg" id="moneytypedatereg">
	 <option value="HKD" {%if pay_obj.moneytypedatereg == 'HKD'%}selected{%endif%}>HKD</option>
	 <option value="USD" {%if pay_obj.moneytypedatereg == 'USD'%}selected{%endif%}>USD</option>
	 <option value="RMB" {%if pay_obj.moneytypedatereg == 'RMB'%}selected{%endif%}>RMB</option>
	 </select></td>
    <td align="left">
		<table width="100%" border="0" cellpadding="0" cellspacing="0" bordercolor="#B1D3EC" bgcolor="#FFFFFF">
			<tr>
			<td width="120"><input type="text" name="datereg_invoice" id="datereg_invoice" value="{{pay_obj.datereg_invoice}}" readonly size="10"></td>
			<td width="120"><input type="text" name="datereg_paid" id="datereg_paid" value="{{pay_obj.datereg_paid}}" readonly size="10"></td>
			<td width="120"><select name="datereg_paiy_by" id="datereg_paiy_by">
				<option value="">Select Please</option>
				 <option value="Cash" {%if pay_obj.datereg_paiy_by == 'Cash'%}selected{%endif%}>Cash</option>
				 <option value="Bank Transfer" {%if pay_obj.datereg_paiy_by == 'Bank Transfer'%}selected{%endif%}>Bank Transfer</option>
				 <option value="Credit Card" {%if pay_obj.datereg_paiy_by == 'Credit Card'%}selected{%endif%}>Credit Card</option>
				 <option value="EPS" {%if pay_obj.datereg_paiy_by == 'EPS'%}selected{%endif%}>EPS</option>
				 <option value="Cheque" {%if pay_obj.datereg_paiy_by == 'Cheque'%}selected{%endif%}>Cheque</option>
				 <option value="T/T" {%if pay_obj.datereg_paiy_by == 'T/T'%}selected{%endif%}>T/T</option>
				 </select></td>
			<td width="120"><select name="datereg_handed_by" id="datereg_handed_by">
			 <option value="">select please</option>
			{%for s in sale_list%}
			 <option value="{{s.name}}" {%if pay_obj.datereg_handed_by == s.name%}selected{%endif%}>{{s.name}}</option>
			 {%endfor%}
			</select></td>
			</tr>
			</table>
	</td>
	</tr>
	</table>


<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
  <td  width="200">1st Installment Due&nbsp;<input type="text" name="date1" id="date1" value="{{pay_obj.date1|date:'d/m/Y'}}" readonly size="10"></td>
  <td  width="200"><input type="text" name="date1_money" id="date1_money" value="{{pay_obj.date1_money}}" />&nbsp;<select name="moneytypedate1" id="moneytypedate1">
	 <option value="HKD" {%if pay_obj.moneytypedate1 == 'HKD'%}selected{%endif%}>HKD</option>
	 <option value="USD" {%if pay_obj.moneytypedate1 == 'USD'%}selected{%endif%}>USD</option>
	 <option value="RMB" {%if pay_obj.moneytypedate1 == 'RMB'%}selected{%endif%}>RMB</option>
	 </select></td>
    <td align="left">
		<table width="100%" border="0" cellpadding="0" cellspacing="0" bordercolor="#B1D3EC" bgcolor="#FFFFFF">
			<tr>
			<td width="120"><input type="text" name="date1_invoice" id="date1_invoice" value="{{pay_obj.date1_invoice}}" readonly size="10"></td>
			<td width="120"><input type="text" name="date1_paid" id="date1_paid" value="{{pay_obj.date1_paid|date:'d/m/Y'}}" readonly size="10"></td>
			<td width="120"><select name="date1_paiy_by" id="date1_paiy_by">
				<option value="">Select Please</option>
				 <option value="Cash" {%if pay_obj.date1_paiy_by == 'Cash'%}selected{%endif%}>Cash</option>
				 <option value="Bank Transfer" {%if pay_obj.date1_paiy_by == 'Bank Transfer'%}selected{%endif%}>Bank Transfer</option>
				 <option value="Credit Card" {%if pay_obj.date1_paiy_by == 'Credit Card'%}selected{%endif%}>Credit Card</option>
				 <option value="EPS" {%if pay_obj.date1_paiy_by == 'EPS'%}selected{%endif%}>EPS</option>
				 <option value="Cheque" {%if pay_obj.date1_paiy_by == 'Cheque'%}selected{%endif%}>Cheque</option>
				 <option value="T/T" {%if pay_obj.date1_paiy_by == 'T/T'%}selected{%endif%}>T/T</option>
				 </select></td>
			<td width="120"><select name="date1_handed_by" id="date1_handed_by">
			 <option value="">select please</option>
			{%for s in sale_list%}
			 <option value="{{s.name}}" {%if pay_obj.date1_handed_by == s.name%}selected{%endif%}>{{s.name}}</option>
			 {%endfor%}
			</select></td>
			</tr>
			</table>
	</td>
	</tr>
	</table>

<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
  <td  width="200">2nd Installment Due&nbsp;<input type="text" name="date2" id="date2" value="{{pay_obj.date2|date:'d/m/Y'}}" readonly size="10"></td>
  <td  width="200"><input type="text" name="date2_money" id="date2_money" value="{{pay_obj.date2_money}}" />&nbsp;<select name="moneytypedate2" id="moneytypedate2">
	 <option value="HKD" {%if pay_obj.moneytypedate2 == 'HKD'%}selected{%endif%}>HKD</option>
	 <option value="USD" {%if pay_obj.moneytypedate2 == 'USD'%}selected{%endif%}>USD</option>
	 <option value="RMB" {%if pay_obj.moneytypedate2 == 'RMB'%}selected{%endif%}>RMB</option>
	 </select></td>
    <td align="left">
		<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
			<tr>
			<td width="120"><input type="text" name="date2_invoice" id="date2_invoice" value="{{pay_obj.date2_invoice}}" readonly size="10"></td>
			<td width="120"><input type="text" name="date2_paid" id="date2_paid" value="{{pay_obj.date2_paid|date:'d/m/Y'}}" readonly size="10"></td>
			<td width="120"><select name="date2_paiy_by" id="date2_paiy_by">
				<option value="">Select Please</option>
				 <option value="Cash" {%if pay_obj.date2_paiy_by == 'Cash'%}selected{%endif%}>Cash</option>
				 <option value="Bank Transfer" {%if pay_obj.date2_paiy_by == 'Bank Transfer'%}selected{%endif%}>Bank Transfer</option>
				 <option value="Credit Card" {%if pay_obj.date2_paiy_by == 'Credit Card'%}selected{%endif%}>Credit Card</option>
				 <option value="EPS" {%if pay_obj.date2_paiy_by == 'EPS'%}selected{%endif%}>EPS</option>
				 <option value="Cheque" {%if pay_obj.date2_paiy_by == 'Cheque'%}selected{%endif%}>Cheque</option>
				 <option value="T/T" {%if pay_obj.date2_paiy_by == 'T/T'%}selected{%endif%}>T/T</option>
				 </select></td>
			<td width="120"><select name="date2_handed_by" id="date2_handed_by">
			 <option value="">select please</option>
			{%for s in sale_list%}
			 <option value="{{s.name}}" {%if pay_obj.date2_handed_by == s.name%}selected{%endif%}>{{s.name}}</option>
			 {%endfor%}
			</select></td>
			</tr>
			</table>
	</td>
	</tr>
	</table>

<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
  <td  width="200">3rd Installment Due&nbsp;<input type="text" name="date3" id="date3" value="{{pay_obj.date3|date:'d/m/Y'}}" readonly size="10"></td>
  <td  width="200"><input type="text" name="date3_money" id="date3_money" value="{{pay_obj.date3_money}}" />&nbsp;<select name="moneytypedate3" id="moneytypedate3">
	 <option value="HKD" {%if pay_obj.moneytypedate3 == 'HKD'%}selected{%endif%}>HKD</option>
	 <option value="USD" {%if pay_obj.moneytypedate3 == 'USD'%}selected{%endif%}>USD</option>
	 <option value="RMB" {%if pay_obj.moneytypedate3 == 'RMB'%}selected{%endif%}>RMB</option>
	 </select></td>
    <td align="left">
		<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
			<tr>
			<td width="120"><input type="text" name="date3_invoice" id="date3_invoice" value="{{pay_obj.date3_invoice}}" readonly size="10"></td>
			<td width="120"><input type="text" name="date3_paid" id="date3_paid" value="{{pay_obj.date3_paid|date:'d/m/Y'}}" readonly size="10"></td>
			<td width="120"><select name="date3_paiy_by" id="date3_paiy_by">
				<option value="">Select Please</option>
				 <option value="Cash" {%if pay_obj.date3_paiy_by == 'Cash'%}selected{%endif%}>Cash</option>
				 <option value="Bank Transfer" {%if pay_obj.date3_paiy_by == 'Bank Transfer'%}selected{%endif%}>Bank Transfer</option>
				 <option value="Credit Card" {%if pay_obj.date3_paiy_by == 'Credit Card'%}selected{%endif%}>Credit Card</option>
				 <option value="EPS" {%if pay_obj.date3_paiy_by == 'EPS'%}selected{%endif%}>EPS</option>
				 <option value="Cheque" {%if pay_obj.date3_paiy_by == 'Cheque'%}selected{%endif%}>Cheque</option>
				 <option value="T/T" {%if pay_obj.date3_paiy_by == 'T/T'%}selected{%endif%}>T/T</option>
				 </select></td>
			<td width="120"><select name="date3_handed_by" id="date3_handed_by">
			 <option value="">select please</option>
			{%for s in sale_list%}
			 <option value="{{s.name}}" {%if pay_obj.date3_handed_by == s.name%}selected{%endif%}>{{s.name}}</option>
			 {%endfor%}
			</select></td>
			</tr>
			</table>
	</td>
	</tr>
	</table>


<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
  <td  width="200">4th Installment Due&nbsp;<input type="text" name="date4" id="date4" value="{{pay_obj.date4|date:'d/m/Y'}}" readonly size="10"></td>
  <td  width="200"><input type="text" name="date4_money" id="date4_money" value="{{pay_obj.date4_money}}" />&nbsp;<select name="moneytypedate4" id="moneytypedate4">
	 <option value="HKD" {%if pay_obj.moneytypedate4 == 'HKD'%}selected{%endif%}>HKD</option>
	 <option value="USD" {%if pay_obj.moneytypedate4 == 'USD'%}selected{%endif%}>USD</option>
	 <option value="RMB" {%if pay_obj.moneytypedate4 == 'RMB'%}selected{%endif%}>RMB</option>
	 </select></td>
    <td align="left">
		<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
			<tr>
			<td width="120"><input type="text" name="date4_invoice" id="date4_invoice" value="{{pay_obj.date4_invoice}}" readonly size="10"></td>
			<td width="120"><input type="text" name="date4_paid" id="date4_paid" value="{{pay_obj.date4_paid|date:'d/m/Y'}}" readonly size="10"></td>
			<td width="120"><select name="date4_paiy_by" id="date4_paiy_by">
				<option value="">Select Please</option>
				 <option value="Cash" {%if pay_obj.date4_paiy_by == 'Cash'%}selected{%endif%}>Cash</option>
				 <option value="Bank Transfer" {%if pay_obj.date4_paiy_by == 'Bank Transfer'%}selected{%endif%}>Bank Transfer</option>
				 <option value="Credit Card" {%if pay_obj.date4_paiy_by == 'Credit Card'%}selected{%endif%}>Credit Card</option>
				 <option value="EPS" {%if pay_obj.date4_paiy_by == 'EPS'%}selected{%endif%}>EPS</option>
				 <option value="Cheque" {%if pay_obj.date4_paiy_by == 'Cheque'%}selected{%endif%}>Cheque</option>
				 <option value="T/T" {%if pay_obj.date4_paiy_by == 'T/T'%}selected{%endif%}>T/T</option>
				 </select></td>
			<td width="120"><select name="date4_handed_by" id="date4_handed_by">
			 <option value="">select please</option>
			{%for s in sale_list%}
			 <option value="{{s.name}}" {%if pay_obj.date4_handed_by == s.name%}selected{%endif%}>{{s.name}}</option>
			 {%endfor%}
			</select></td>
			</tr>
			</table>
	</td>
	</tr>
	</table>

<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr><td align="right"><input type="submit" name="gosave" value=" Save " />{{errinfo}}</td></tr></table>
</form>



<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr><td align="left" style="padding-left:10px;">
	Program Enrolled: {%for pp in ppay_list%}
	<a href="/v2/pay_record/{{s_obj.id}}/?program_id={{pp.project.id}}"><b>{%if pp_obj == pp.project %}<font color='red'>{%endif%}{{pp.project.name}}{%if pp_obj == pp.project %}</font>{%endif%}</b></a>
	&nbsp;&nbsp;{%endfor%}
  </td></tr></table>

</div>
{% endblock %}
